package com.wsx.ones.boot.test.dubbox;

import com.wsx.ones.boot.model.User;

import java.util.Date;

/**
 * Created by wangshuaixin on 17/6/7.
 */
public abstract class AbstractCommonApi {

    public Integer before(User user) {
        if (null == user) {
            return SwapStatus.ERROR.getStatus();
        }
        user.setName(user.getName() + user.getId());
        return SwapStatus.SUCCESS.getStatus();
    }

    public Integer after(User user) {
        if (1 == user.getId()) {
            return SwapStatus.UNKNOW.getStatus();
        }
        user.setBirth(new Date());
        return SwapStatus.SUCCESS.getStatus();
    }
}
